const mongoose = require("mongoose");
const { dbUrl } = require("./url");
const {
    startScheduler
} = require("./scheduler");
// const { initDatabase } = require("./initdatabase")
const { isPro } = require('./url');
// const { bill } = require("../models/bill");
mongoose
    .connect(dbUrl)
    .then(async () => {
        dbUrl.includes('47.98.220.209') ? console.log("线上数据库连接成功") : console.log("本地数据库连接成功")
        // initDatabase();
        isPro == 1 && startScheduler();

    })
    .catch((err) => {
        dbUrl.includes('47.98.220.209') ? console.log("线上数据库连接失败") : console.log("本地数据库连接失败")
        console.log(err);
    });



